import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useXxglStore = defineStore(
  'xxgl',
  () => {
    // 第一次进入页面提示紧急消息
    const show = ref<boolean>(false)
    const changeShow = (flag: boolean) => {
      show.value = flag
    }
    const wdxxsl = ref<number>(0)
    const setWdxxsl = (val: number) => {
      wdxxsl.value = val
    }
    return {
      show,
      changeShow,
      wdxxsl,
      setWdxxsl,
    }
  },
  {
    // 持久化设置（默认存储sessionStorage，https://seb-l.github.io/pinia-plugin-persist/advanced/partial-state.html）
    persist: { enabled: true },
  },
)
